//面向对象
// 接口继承和类
//狼吃羊
class Animal {
    static age = '';
    private name:string;
    protected type:string;
    constructor(name,type){
        this.name = name;
        this.type = type;
    }
    move(speed = 10){
        console.log(`${this.name}以${speed}的速度在移动`);
    }
}

class Sheep extends Animal{

    constructor(){
        super('羊','食草动物')
    }
    move(speed: number = 22) {
        this.type;
        super.move(speed);
    }
    eat(){
        console.log("吃草")
    }
}

class Wolf extends Animal{

    constructor(){
        super('狼','食肉动物')
    }
    move(speed: number = 22) {
        super.move(speed);
    }
    eat(){
        console.log("吃羊")
    }
}
let w = new Wolf();
// w.name; 私有属性不能访问
w.eat();

class Mysql {
    public static instance = 10;
}
Mysql.instance;

class Person{
    constructor(public username){
        this.username = username;
    }
}